//
// Created by ZLY on 2025/5/9.
//

#ifndef EFFECT_H
#define EFFECT_H

#include "../core/object_world.h"
#include "../affiliate/sprite_anim.h"
#include <string>

class Effect : public ObjectWorld {
private:
    SpriteAnim *sprite_ = nullptr;
    ObjectWorld *nextObject_ = nullptr;

    void checkFinished();

public:
    static Effect *addEffectChild(Object *parent, const std::string &file_path, glm::vec2 pos, float scale = 1.0f,
                                  ObjectWorld *next_object = nullptr);

    void update(float dt) override;

    void setSpriteAnim(SpriteAnim *sprite) {
        sprite_ = sprite;
    };

    void setNextObject(ObjectWorld *nextObject) { nextObject_ = nextObject; }

    SpriteAnim *getSpriteAnim() const { return sprite_; }
    ObjectWorld *getNextObject() const { return nextObject_; }
    void clean() override;
};


#endif //EFFECT_H
